<?php

namespace app\admin\model\shop;

use think\Model;

class ShopGoodsStockLogModel extends Model
{
    protected $name = 'shop_goods_stock_log';


    public const TYPE_IN = 100;// 系统添加库存
    public const TYPE_OUT = 200;// 系统扣除库存
    public const TYPE_ORDER = 300;// 下单扣除
    public const TYPE_DEL = 400;// 删除店铺商品
    public const TYPE_ROLL = 500;// 订单取消退回库存


    public const TYPE_ARRAY_TEXT = [
        self::TYPE_IN => 'System in',
        self::TYPE_OUT => 'System out',
        self::TYPE_ORDER => 'Place order',
        self::TYPE_DEL => 'Del Goods',
        self::TYPE_ROLL => 'Inventory return',
    ];


    /**
     * Notes: 添加日志
     * User: AerYYY
     * Date: 6/29/25
     * @param $params
     */
    public static function add($params)
    {
        self::insert($params);
    }
}